<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/secion1.css">
    <title>Document</title>
</head>
<body>
    <div class="top">
        <div>
            <img src="image/2.png" alt="">
            <p>网络全案营销服务提供商</p>
        </div>
        <ul>
            <li><a href="index.html">网站首页</a></li>
            <li><a href="">传悦资源</a></li>
            <li><a href="list1.html">传悦案例</a></li>
            <li><a href="">解决方案</a></li>
            <li><a href="">需求提交</a></li>
        </ul>
    </div>

    <div class="pic">
        <div class="pic-1">
            <div class="pic-2">
            <span class="span1">网站首页 ></span>
            <span class="span2">解决方案</span>
            </div>
        </div>
    </div>

    <div class="box" id="dd">
        <ul id="ul">
        <div >
            <img src="image/new.png" alt="" id="first">
                <p>2013-09</p>
                <h1>27</h1>
        </div>
            <li>
                <a href="secion2.html">
                <img src="image/secion1.png" alt="" class="picture">
                <h2 class="title">行业合作专题，针对旅游行业的资源打散再重组 </h2>
                <span class="name">标签：    资源整合      旅游行业      行业专题                                </span>
                <p class="room">根据游客不同阶段的不同需求，已然可相应引导出不同的媒介资源，串联起所有需求，在不同阶段营造出不同的传播策略，达到既全 面，但是</p>
                </a>
            </li>
            
        </ul>
    </div>
    
    <div class="bottom">
        <img src="image/2.png" alt="">
        <ul>
            <li>关于传悦</li>
            <li>新闻动态</li>
            <li>传悦观点</li>
            <li>联系传悦</li>
            <li>加入传悦</li>
            <li>付款账户</li>
        </ul>
        <p>Copyright ©2013  创梦网络科技有限责任公司  ‖  传悦 Chnyoo.cn All Rights Reser</p>
    </div>
</body>
</html>
<script>
    let http = new XMLHttpRequest();
    let ul = document.getElementById("ul");
    let dd = document.getElementById("dd")
    let first = document.getElementById("first")
    http.open("get",`http://10.35.164.163:81/secionlist`);
    http.send();
    http.onreadystatechange = function(){
        if(http.readyState === 4){
            let list1 = JSON.parse(http.responseText)
            list1.forEach(function(item){
                let newli = ul.cloneNode(true);
                // ul.style.display = "block";
                ul.appendChild(newli);
                newli.querySelector("#first").style.display = "none"
                newli.querySelector(".picture").src = item.picture;
                newli.querySelector(".title").innerHTML = item.title;
                newli.querySelector(".name").innerHTML = item.name;
                newli.querySelector(".room").innerHTML = item.room;
                newli.id = item.id;
                newli.onclick = function(){
                    let id = newli.id
                //    console.log(id)
                    let http = new XMLHttpRequest();
                    http.open("get",`http://10.35.164.163:81/click2?id=${id}`)
                    http.send();
                    http.onreadystatechange = function(){
                        if(http.readyState === 4){

                        }
                    }
                } 
            })
        }
    }
</script>